package com.hsteach.service.activity;

import java.util.List;

import com.hsteach.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hsteach.dao.mapper.activity.ActivityFilesMapper;
import com.hsteach.dao.domain.activity.ActivityFiles;

/**
 * 活动附件Service业务层处理
 * 
 * @author fanxquer
 * @date 2023-07-11
 */
@Service
public class ActivityFilesService
{
    @Autowired
    private ActivityFilesMapper activityFilesMapper;

    /**
     * 查询活动附件
     * 
     * @param id 活动附件主键
     * @return 活动附件
     */
    public ActivityFiles selectActivityFilesById(Long id)
    {
        return activityFilesMapper.selectActivityFilesById(id);
    }

    /**
     * 查询活动附件列表
     * 
     * @param activityFiles 活动附件
     * @return 活动附件
     */
    public List<ActivityFiles> selectActivityFilesList(ActivityFiles activityFiles)
    {
        return activityFilesMapper.selectActivityFilesList(activityFiles);
    }

    /**
     * 新增活动附件
     * 
     * @param activityFiles 活动附件
     * @return 结果
     */
    public int insertActivityFiles(ActivityFiles activityFiles)
    {
        activityFiles.setCreateTime(DateUtils.getNowDate());
        return activityFilesMapper.insertActivityFiles(activityFiles);
    }

    /**
     * 修改活动附件
     * 
     * @param activityFiles 活动附件
     * @return 结果
     */
    public int updateActivityFiles(ActivityFiles activityFiles)
    {
        activityFiles.setUpdateTime(DateUtils.getNowDate());
        return activityFilesMapper.updateActivityFiles(activityFiles);
    }

    /**
     * 批量删除活动附件
     * 
     * @param ids 需要删除的活动附件主键
     * @return 结果
     */
    public int deleteActivityFilesByIds(Long[] ids)
    {
        return activityFilesMapper.deleteActivityFilesByIds(ids);
    }

    /**
     * 删除活动附件信息
     * 
     * @param id 活动附件主键
     * @return 结果
     */
    public int deleteActivityFilesById(Long id)
    {
        return activityFilesMapper.deleteActivityFilesById(id);
    }
}
